<template>
  <div class="anli-cont">
    <div class="anli-carousel">
      <div v-swiper:mySwiper="swiperOption">
        <div class="swiper-wrapper">
          <div class="swiper-slide" v-for="(banner, index) in banners" :key="index">
            <div class="anli-item">
              <img :src="banner" alt="">
            </div>
          </div>
        </div>
        <!-- <div class="swiper-pagination swiper-pagination-bullets"></div> -->
      </div>
    </div>

    <div class="anli-control-prev">
      <Icon type="ios-arrow-back" size="30"></Icon>
    </div>
    <div class="anli-control-next">
      <Icon type="ios-arrow-forward" size="30"></Icon>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      banners: [
        '/images/anli2.png',
        '/images/anli3.png',
        '/images/anli1.png'
      ],
      swiperOption: {
        loop: true,
        slidesPerView: 3,
        centeredSlides: true,
        spaceBetween: 23,
        // pagination: {
        //   el: '.swiper-pagination',
        //   dynamicBullets: true
        // },
        navigation: {
          nextEl: '.anli-control-next',
          prevEl: '.anli-control-prev',
        },
        on: {
          slideChange() {
            console.log('onSlideChangeEnd', this);
          },
          tap() {
            console.log('onTap', this);
          }
        }
      }
    }
  }
}
</script>

<style lang="less" scoped>

.anli-control-prev {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: -60px;
  outline: none;
  background: #f5f5f7;
  border: 2px solid #ddd;
  border-radius: 50%;

  &:hover {
    background: #00a0e9;
    border-color: #00a0e9;
    color: #fff;
  }
}
.anli-control-next {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  right: -60px;
  outline: none;
  background: #f5f5f7;
  border: 2px solid #ddd;
  border-radius: 50%;

  &:hover {
    background: #00a0e9;
    border-color: #00a0e9;
    color: #fff;
  }
}
.anli-cont {
  width: 1100px;
  margin: 70px auto 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: relative;

  .anli-carousel {
    display: flex;
    flex-grow: 1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }

  .anli-item {
    // margin-right: 38px;
    // margin: 0 20px;
    width: 350px;
    height: 263px;

    img {
      width: 350px;
      height: 263px;
    }
  }
}
</style>
